const counters = document.querySelectorAll('.count');
const tCount = 12000;
const yCount = 5000;
const fCount = 7500;

const setCount = () => {
  // 打造时间差
  let timer = 50;
  // 重点在于同时开始，同时停止
  let tInter = setInterval(() => {
    counters[0].innerText = Number(counters[0].innerText) + tCount / timer;
  }, 100);

  let yInter = setInterval(() => {
    counters[1].innerText = Number(counters[1].innerText) + yCount / timer;
  }, 100);

  let fInter = setInterval(() => {
    counters[2].innerText = Number(counters[2].innerText) + fCount / timer;
  }, 100);
  // 清楚循环定时器
  setTimeout(() => {
    clearInterval(tInter);
    clearInterval(yInter);
    clearInterval(fInter);
  }, timer * 100);
};

setCount();
